package cn.haohaowo;

import cn.haohaowo.config.CommonProperties;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class SomeController {

	private static final Logger log = LoggerFactory.getLogger(SomeController.class);


	@Autowired
	private SomeConfig someConfig;

	@Autowired
	private CommonProperties commonProperties;
	
	@GetMapping("/some.do")
	public String getSome() {
		return someConfig.getMessage();
	}

	@GetMapping("/config.do")
	public String getConfig() {
		return JSONObject.toJSONString(commonProperties);
	}




//	@KafkaListener(topics = "test")
	public void doXiaodi1() {
		log.info("xiaodi 1 xiangying");
	}

//	@KafkaListener(topics = "test")
	public void doXiaodi2() {
		log.info("xiaodi 2 xiangying");
	}
	
}
